jQuery(function() {

	var entityId = bidId;
	var url = window.rootPath + '/ui/task/' + taskId;
	jQuery('.app-btn-pass').on('click', function() {
		jQuery('#loadingImage').show();
		jQuery(".btn").attr("disabled", true);
		jQuery.ajax({
			url : encodeURI(url),
			method : "post",
			data : JSON.stringify({
				"auditState" : "通过",
				"auditAdvice" : jQuery('#auditAdvice').val(),
				"taskId" : taskId

			}),
			contentType : 'application/json;charset=utf-8',
			dataType : 'json',
			success : function() {
				jQuery(".btn").attr("disabled", false);
				jQuery('#loadingImage').hide();
				window.location = window.rootPath + '/ui/index';
			}
		});
	});
	jQuery('.app-btn-reject').on('click', function() {
		jQuery('#loadingImage').show();
		jQuery(".btn").attr("disabled", true);
		jQuery.ajax({
			url : encodeURI(url),
			method : "post",
			data : JSON.stringify({
				"auditState" : "驳回",
				"auditAdvice" : jQuery('#auditAdvice').val(),
				"taskId" : taskId
			}),
			contentType : 'application/json;charset=utf-8',
			dataType : 'json',
			success : function(data) {
				jQuery(".btn").attr("disabled", false);
				jQuery('#loadingImage').hide();
				window.location = window.rootPath + '/ui/index';
			}
		});
	});
	jQuery(".btnList1").on("click", function(e) {
		e.preventDefault();
        var bidId=jQuery('#bidId').val();
		filedown(bidId,'保函','2');
	});
	
	jQuery(".btnList2").on("click", function(e) {
		e.preventDefault();
        var bidId=jQuery('#bidId').val();
		filedown(bidId,'技术方案','1');
	});
});
